USE [ION_Network]
GO

/****** Object:  Table [dbo].[PL_TOU_PriceBoard]    Script Date: 08/17/2011 09:11:55 ******/
SET ANSI_NULLS ON
GO

SET QUOTED_IDENTIFIER ON
GO

IF OBJECT_ID('dbo.PL_TOU_PriceBoard') IS NOT NULL
 DROP TABLE dbo.PL_TOU_PriceBoard
GO

CREATE TABLE [dbo].[PL_TOU_PriceBoard](	
	[StoreName] nvarchar(200) NOT NULL,
	[TimeOfUse_ID] [int] NOT NULL,
	[Price] [decimal](18, 0) NOT NULL,
 CONSTRAINT [PK_PL_TOU_PriceBoard] PRIMARY KEY CLUSTERED 
(
	[StoreName] ASC,
	[TimeOfUse_ID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

GO

ALTER TABLE [dbo].[PL_TOU_PriceBoard] ADD  CONSTRAINT [DF_PL_TOU_PriceBoard_Price]  DEFAULT ((0)) FOR [Price]
GO

ALTER TABLE [dbo].[PL_TOU_PriceBoard]  WITH CHECK ADD  CONSTRAINT [FK_PL_TOU_PriceBoard_PL_TOU_TimeOfUse] FOREIGN KEY([TimeOfUse_ID])
REFERENCES [dbo].[PL_TOU_TimeOfUse] ([TimeOfUse_ID])
GO

ALTER TABLE [dbo].[PL_TOU_PriceBoard] CHECK CONSTRAINT [FK_PL_TOU_PriceBoard_PL_TOU_TimeOfUse]
GO

